<script setup lang="ts">
import { centerListService } from '@/api/user'
import { onMounted, ref } from 'vue'
import { useCenterStore } from '@/stores'

const loading = ref(false)
const personnelTable = ref() // 人员列表
const useCenter = useCenterStore()
const equipmentShow =ref(true)



const getpersonal = async () => {
  loading.value = true
  const { data } = await centerListService()
  loading.value = false
  personnelTable.value = data
  console.log(data, '中心')
}
onMounted(() => {
  getpersonal()
})

const submitForm = async () => {
  // await FireCenterDetailsForm2.value.formRef.validate()
  console.log('过校验了没')
  useCenter.centerChange(false)
}
</script>

<template>
  <div class="equipmentInformation-page">
    <div class="equipmentHeader">
      <FormHeader :equipmentShow="equipmentShow"></FormHeader>
    </div>
    <el-card class="cardHeader">
      <MainTable :loading="loading" :centerTable="personnelTable"></MainTable>
      <el-footer>
        <el-button type="primary" @click="submitForm"> 保存 </el-button>
      </el-footer>
    </el-card>
  </div>
</template>

<style lang="scss" scoped>
.equipmentInformation-page {
  padding: 4px;
  .equipmentHeader{
    margin-top: -10px;
  }
  .cardHeader {
    margin-top: 4px;
  }
  .el-footer {
    margin-top: 30px;
    text-align: center;
  }
}
</style>
